6  Software Design Description

6.1 Overall Description

6.1.1 Assumptions

6.1.2 Design Constraints

6.1.3 Technology Suggestion

6.2 System Architecture Design

6.2.1 Overall Architecture

Figure 6.1: Overall architecture

Component Description
Chain Node (CN) A node of the blockchain. This stores the records and handles the history and transaction requests from the Request Server (Change/View the score, information, etc.)
Request Server The off-chain backend of a CN. This stores the pending requests from the user and is the only way to call a request to the CN. Each Request Server may have a different way to handle user requests (Voting, Direct Request, etc.)
Frontend Server Provide the UX/UI for interacting with the Request Server

6.2.2 System Architecture

6.2.3 Package Diagram

Figure 6.2: Package Diagram of Request Server

Package Name Description
root Main classes
api The abstract classes & interfaces
entity The entities of the database
handler The handlers of the endpoints of the REST API server
internal Internal classes used by other packages
internal/student The instances of the Student Updater
model The input / output objects
model/input The input objects for the handlers
model/output The output objects returned from the handlers
model/fabric The models used internally by the student updater

6.3 System Detailed Design

6.3.1 Class Diagram

Figure 6.3: Class Diagram of the Request Server

6.3.2 Sequence Diagram

6.4 Class Specification

6.5 Data & Database Design

6.5.1 Database Design

Figure 6.4: Database Design of the Request Server

6.5.1.1 Account

Field Name Type Size Unique Not Null Flag Notes
ID bigint x x PK
USERNAME character varying 255 x x
HASHEDPASSWORD character varying 255 x
SALT character varying 255 x
ROLE character varying 255 x
CREATEDAT timestamp x

6.5.1.2 Profile

Field Name Type Size Unique Not Null Flag Notes
ACCOUNT_ID bigint x x PK, FK
ADDRESS character varying 255 x
AVATAR character varying 255 x
BIRTHDATE timestamp x
EMAIL character varying 255 x
FIRSTNAME character varying 255 x
LASTNAME character varying 255 x
MALE boolean x
PHONE character varying 255 x
UPDATED boolean x Used internally by student updater

6.5.1.3 Student

Field Name Type Size Unique Not Null Flag Notes
ACCOUNT_ID bigint x x PK, FK
ETHNIC character varying 255 x
FATHERJOB character varying 255 x
FATHERNAME character varying 255 x
GUARDIANJOB character varying 255 x
GUARDIANNAME character varying 255 x
HOMETOWN character varying 255 x
MOTHERJOB character varying 255 x
MOTHERNAME character varying 255 x

6.5.1.4 Classroom

Field Name Type Size Unique Not Null Flag Notes
ID bigint x x PK
NAME character varying 255 x
GRADE character varying 255 x
HOMEROOMTEACHER_ID bigint x FK
START_YEAR integer x

6.5.1.5 Class Student

Field Name Type Size Unique Not Null Flag Notes
ID bigint x x PK
CLASSROOM_ID bigint x FK
STUDENT_ID bigint x FK

6.5.1.6 Class Teacher

Field Name Type Size Unique Not Null Flag Notes
ID bigint x x PK
CLASSROOM_ID bigint x FK
TEACHER_ID bigint x FK
SUBJECTID bigint x Defined in the system’s config

6.5.1.7 Record

Field Name Type Size Unique Not Null Flag Notes
ID bigint x x PK
CLASSROOM_ID bigint x FK
STUDENT_ACCOUNT_ID bigint x FK

6.5.1.8 Record Entry

Field Name Type Size Unique Not Null Flag Notes
ID bigint x x PK
RECORD_ID bigint x FK
REQUESTER_ID bigint FK
TEACHER_ID bigint FK
APPROVER_ID bigint FK
APPROVALDATE timestamp x
REQUESTDATE timestamp x
FIRSTHALFSCORE double precision x
SECONDHALFSCORE double precision x
FINALSCORE double precision x
SUBJECTID bigint x Defined in the system’s config
UPDATECOMPLETE boolean x Used internally by student updater

6.5.1.9 Pending Record Entry

Field Name Type Size Unique Not Null Flag Notes
ID bigint x x PK
RECORD_ID bigint x FK
REQUESTER_ID bigint x FK
TEACHER_ID bigint x FK
REQUESTDATE timestamp x
FIRSTHALFSCORE double precision x
SECONDHALFSCORE double precision x
FINALSCORE double precision x
SUBJECTID bigint x Defined in the system’s config

6.5.2 Updater Key

Field Name Type Size Unique Not Null Flag Notes
ID character varying 255 x x PK
STUDENT_ACCOUNT_ID bigint x FK

6.5.3 Data File Design

File Name Type Notes
db Folder The folder of The H2 Database files
updater Folder Contains the data files of the local student updater